package com.zzl.finance.data.manamger;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zzl.finance.data.entity.FinanceInstitutyEntity;
import com.zzl.finance.data.service.EnterpriseService;
import com.zzl.finance.data.service.FinanceInstitutyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ：hyt
 * @description：金融机构通用逻辑处理
 * @date ：2021/12/7 13:24
 */
@Slf4j
@Component
public class FinanceInstitutyManager {

    @Autowired
    private FinanceInstitutyService financeInstitutyService;

    @Autowired
    private EnterpriseService enterpriseService;

    /**
     * 通过金融机构ids查询金融机构
     *
     * @param ids
     * @return
     */
    public List<FinanceInstitutyEntity> listByIds(List<Integer> ids) {
        QueryWrapper<FinanceInstitutyEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().in(FinanceInstitutyEntity::getId, ids);
        return financeInstitutyService.list(queryWrapper);
    }
}
